package com.jml.consumer;

import com.jml.entity.OrderEntity;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Service;


/*
CONCURRENTLY：默认的表示接收消息异步处理
ORDERLY：接收消息同步处理
*/
@Service
@RocketMQMessageListener(topic = "jmltopic",
        consumerGroup = "jmlTopic",
        consumeThreadMax = 1,
        consumeMode = ConsumeMode.CONCURRENTLY
        )
public class OrdeConsumer implements RocketMQListener<OrderEntity> {
    @Override
    public void onMessage(OrderEntity o) {
        System.out.println("o:" + o.toString());
    }
}
